﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommandPattern
{
    public class Broker
    {
        private List<Order> orders = new List<Order>();

        public void TakeOrder(Order order)
        {
            orders.Add(order);
        }

        public void PlaceOrders()
        {
            foreach (var item in orders)
            {
                item.Execute();
            }

            orders.Clear();
        }
    }
}
